package Router

import (
	"github.com/gin-gonic/gin"
	"repair/Controller"
)

func CollocetRouter(r *gin.Engine) *gin.Engine {
	//用户router
	r.POST("/repair/customer/register", Controller.Register)
	r.POST("/repair/customer/login", Controller.Customer_Login)
	r.PUT("/repair/customer/modify",Controller.Customer_modify)
	r.POST("/repair/customer/set_table", Controller.Set_Table)
	r.GET("/repair/customer/gettable", Controller.GetTable)
	r.GET("/repair/customer/get_table", Controller.Select_Table)//查询维修表
	r.DELETE("/repair/customer/delete_table",Controller.Delete_Table)
	r.PUT("/repair/customer/update_table",Controller.Update_Table)
	r.POST("/repair/customer/status",Controller.Maintenance_status)//返回订单的状态
	//员工router
	r.POST("/repair/staff/login", Controller.Staff_Login)
	r.GET("/repair/staff/task_scheduling/Undistribution", Controller.Get_Undistribution)//查询未分配工程师的维修单
	r.GET("/repair/staff/task_scheduling/distribution", Controller.Distribution_Engineer)
	//库存router
	r.POST("/repairock/ad",Controller.Setsparepart)
	r.POST("/repairock/in",Controller.Stock_in)
	r.POST("/repairock/out",Controller.StockOut)
	r.GET("/repairock/inquire",Controller.Stock_inquire)
	r.GET("/repairock/inquire/single",Controller.Stock_inquire_single)
    r.DELETE("/repair/stock/delete",Controller.Stock_delete)
	//客服
	r.POST("/repair/service/enter",Controller.Customerservice_enter)//客服录入客户信息
	r.PUT("/repair/service/modify",Controller.Customerservice_modify)//客服修改客户信息
	r.DELETE("/repair/service/delete",Controller.Customer_delete)//客服删除客户信息
	r.GET("/repair/service/inquire",Controller.Customer_inquire)//客户查看整个客户表的信息
	r.GET("/repair/service/inquire/single",Controller.Customer_inquire_single)//客服查询某个客户的个人信息
	r.PUT("/repair/service/modifyrepair",Controller.Repair_information)//客户进行报修设备的维护
	r.PUT("/repair/service/modify/record",Controller.Update_Table)//客服进行报修记录的维护
	r.POST("/repair/service/Confirmrepair",Controller.Confirm_repair)//客服返回一个客户确认单
	return r
}
